package com.cxso.example.request.wlpt;

import com.cxso.example.enums.wlpt.FeeTypeEnum;
import com.cxso.example.enums.wlpt.IncomeTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

@Getter
@Setter
@Schema(description = "申请支付入参")
public class ApiConsignorPaymentApplyReq extends ApiBaseReq {

    @Schema(description = "运单ID（运单ID和运单编号二选一必填）")
    private String id;

    @Schema(description = "运单编号（运单ID和运单编号二选一必填）")
    private String billCode;

    @Schema(description = "申请信息")
    @NotEmpty(message = "申请信息不可为空")
    @Valid
    private List<ClientBillApplyFeeDomain> billApplyFeeLists;

    @Getter
    @Setter
    public static class ClientBillApplyFeeDomain {

        @Schema(description = "费用类型")
        @NotNull(message = "费用类型不能为空")
        private FeeTypeEnum feeType;

        @Schema(description = "费用名称")
        @NotBlank(message = "费用名称不能为空")
        private String feeName;

        @Schema(description = "收款方式")
        @NotNull(message = "收款方式不能为空")
        private IncomeTypeEnum incomeType;

        @Schema(description = "收款人ID")
        @NotBlank(message = "收款人ID不能为空")
        private String payeeId;

        @Schema(description = "申请金额")
        @NotNull(message = "申请金额不能为空")
        private BigDecimal applyAmount;

    }

}
